<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Cache-Control" content="no-siteapp" />
 <link href="/statics/assets/css/bootstrap.min.css" rel="stylesheet" />
        <link rel="stylesheet" href="/statics/css/style.css"/>
        <link href="/statics/assets/css/codemirror.css" rel="stylesheet">
        <link rel="stylesheet" href="/statics/assets/css/ace.min.css" />
        <link rel="stylesheet" href="/statics/font/css/font-awesome.min.css" />
        <!--[if lte IE 8]>
		  <link rel="stylesheet" href="/statics/assets/css/ace-ie.min.css" />
		<![endif]-->
		<script src="/statics/js/jquery-1.9.1.min.js"></script>
        <script src="/statics/assets/js/bootstrap.min.js"></script>
		<script src="/statics/assets/js/typeahead-bs2.min.js"></script>
		<script src="/statics/assets/js/jquery.dataTables.min.js"></script>
		<script src="/statics/assets/js/jquery.dataTables.bootstrap.js"></script>
        <script src="/statics/assets/layer/layer.js" type="text/javascript" ></script>
        <script src="/statics/assets/laydate/laydate.js" type="text/javascript"></script>
       <script src="/statics/js/video_list.js" type="text/javascript" ></script>
<title>留言</title>
</head>

<body>
<div class="margin clearfix">
 <div class="Guestbook_style">
 <div class="search_style">
     
      <ul class="search_content clearfix">
          <li><label class="l_f">分类:</label>&nbsp;&nbsp;&nbsp;&nbsp;
              <input class="myrdo" type="radio" name="classify" value="全部" checked="checked"/><span class="radio-text">全部</span>&nbsp;&nbsp;&nbsp;&nbsp;
              <input class="myrdo" type="radio" name="classify" value="首页视频" /><span class="radio-text">首页视频</span>&nbsp;&nbsp;&nbsp;&nbsp;
              <input class="myrdo" type="radio" name="classify" value="新闻视频" /><span class="radio-text">新闻视频</span>&nbsp;&nbsp;&nbsp;&nbsp;

          </li>
       <li><label class="l_f">视频编号</label><input name="idValue" id="idValue" type="text" class="text_add" placeholder="输入视频编号" style=" width:250px"></li>
       <li style="width:90px;"><button type="button" class="btn_search"><i class="fa fa-search" onclick="subbut();"></i>查询</button></li>
      </ul>
    </div>
    <div class="border clearfix">
       <span class="l_f">
        <a href="/official/picture-add.html" title="添加视频" class="btn btn-warning Order_form"><i class="icon-plus"></i>添加商品</a>
        <a href="javascript:ovid()" class="btn btn-danger"><i class="icon-trash"></i>批量删除</a>
       </span>
       <span class="r_f">共：<b>${count}</b>条视频</span>
     </div>
    <!--留言列表-->
    <div class="Guestbook_list">
      <table class="table table-striped table-bordered table-hover" id="sample-table">
      <thead>
		 <tr>
          <th width="25"><label><input type="checkbox" class="ace"><span class="lbl"></span></label></th>
          <th width="80">编号</th>
          <th width="200px">视频</th>
           <th width="100px">开关</th>
          <th width="80px">视频类型</th>
          <th width="80px">分类</th>
          <th width="100px">id值</th>
          <th width="250">操作</th>
          </tr>
      </thead>
          <tbody id="sertbody">
          <c:forEach items="${list.videoList}" var="li">
              <tr>
                  <td width="25px"><label><input type="checkbox" class="ace" ><span class="lbl"></span></label></td>
                  <td width="80px">${li.id}</td>
                  <td width="200px">
                      <video id="${li.idValue}" width="300px">
                          <source src="${li.videoSrc}" type="${li.type}">
                      </video>
                  </td>
                  <td width="100px"><button onclick="playPause(${li.idValue});">播放/暂停</button></td>
                  <td width="80px">${li.type}</td>
                  <td width="80px">${li.classify}</td>
                  <td width="100px">${li.idValue}</td>
                  <td class="td-manage">

                      <a title="编辑" onclick="member_edit('编辑','member-add.html','4','','510')" href="javascript:;"  class="btn btn-xs btn-info" ><i class="icon-edit bigger-120"></i></a>
                      <a title="删除" href="javascript:;"  onclick="member_del(this,'1')" class="btn btn-xs btn-warning" ><i class="icon-trash  bigger-120"></i></a>
                  </td>
              </tr>

          </c:forEach>

          </tbody>
          <tfoot id="sertfoot">
          <tr class="">
              <td colspan="8" class="text-center">
                  <c:if test="${list.pageNo!=1}">
                      <a id="suoye" href="javascript:suoye();" style="cursor: pointer;">首页</a>
                      <a id="upye" href="javascript:upye();" style="cursor: pointer;">上一页</a>
                  </c:if>

                  <c:if test="${list.pageNo!=list.pageTotal}">
                      <a id="downye" href="javascript:downye();" name="down" value="下一页" style="cursor: pointer;">下一页</a>
                      <a id="meiye" href="javascript:meiye();" style="cursor: pointer;">尾页</a>
                  </c:if>
              </td>
          </tr>

          </tfoot>
      </table>
    </div>
 </div>
</div>

</body>
</html>

<script type="text/javascript">
 /*用户-查看*/
function member_show(title,url,id,w,h){
	layer_show(title,url+'#?='+id,w,h);
}
/*留言-删除*/
function member_del(obj,id){
	layer.confirm('确认要删除吗？',function(index){
		$(obj).parents("tr").remove();
		layer.msg('已删除!',{icon:1,time:1000});
	});
}
/*视频*/
 function playPause(data) {
     if (data.paused)
         data.play();
     else
         data.pause();
 }

/*checkbox激发事件*/
$('#checkbox').on('click',function(){
	if($('input[name="checkbox"]').prop("checked")){
		 $('.Reply_style').css('display','block');
		}
	else{
		
		 $('.Reply_style').css('display','none');
		}	
	})
/*留言查看*/
function Guestbook_iew(id){
	var index = layer.open({
        type: 1,
        title: '留言信息',
		maxmin: true, 
		shadeClose:false,
        area : ['600px' , ''],
        content:$('#Guestbook'),
		btn:['确定','取消'],
		yes: function(index, layero){		 
		  if($('input[name="checkbox"]').prop("checked")){			 
			 if($('.form-control').val()==""){
				layer.alert('回复内容不能为空！',{
               title: '提示框',				
			  icon:0,		
			  }) 
			 }else{			
			      layer.alert('确定回复该内容？',{
				   title: '提示框',				
				   icon:0,	
				   btn:['确定','取消'],	
				   yes: function(index){					   
					     layer.closeAll();
					   }
				  }); 		  
		   }			
	      }else{			
			 layer.alert('是否要取消回复！',{
               title: '提示框',				
			icon:0,		
			  }); 
			  layer.close(index);      		  
		  }
	   }
	})	
};
	/*字数限制*/
function checkLength(which) {
	var maxChars = 200; //
	if(which.value.length > maxChars){
	   layer.open({
	   icon:2,
	   title:'提示框',
	   content:'您输入的字数超过限制!',	
    });
		// 超过限制的字数了就将 文本框中的内容按规定的字数 截取
		which.value = which.value.substring(0,maxChars);
		return false;
	}else{
		var curr = maxChars - which.value.length; //250 减去 当前输入的
		document.getElementById("sy").innerHTML = curr.toString();
		return true;
	}
};
</script>
<script type="text/javascript">
jQuery(function($) {
		var oTable1 = $('#sample-table').dataTable( {
		"aaSorting": [[ 1, "desc" ]],//默认第几个排序
		"bStateSave": true,//状态保存
		"aoColumnDefs": [
		  //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
		  {"orderable":false,"aTargets":[0,2,3,5,6]}// 制定列不参与排序
		] } );
				$('table th input:checkbox').on('click' , function(){
					var that = this;
					$(this).closest('table').find('tr > td:first-child input:checkbox')
					.each(function(){
						this.checked = that.checked;
						$(this).closest('tr').toggleClass('selected');
					});
						
				});	
				$('[data-rel="tooltip"]').tooltip({placement: tooltip_placement});
				function tooltip_placement(context, source) {
					var $source = $(source);
					var $parent = $source.closest('table')
					var off1 = $parent.offset();
					var w1 = $parent.width();
			
					var off2 = $source.offset();
					var w2 = $source.width();
			
					if( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right';
					return 'left';
				}
			})
</script>
